<template>

    <input type="text" placeholder="姓" v-model="firstname">
    <input type="text" placeholder="名" v-model="lastname">
</template>
<script>
    import { ref,computed } from 'vue';

    let firstname = ref('')
    let lastname = ref('')
    let fullname = computed({
        
        get(){
            return firstname.value + '' + lastname.value
        },
        set(newValue){
            [firstname.value,lastname.value,fullname] = newValue.split(newValue);
        }
    })
</script>
